package fr.umlv.m2.uwp2011.persistence.matiere.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import fr.umlv.m2.uwp2011.framework.hibernate.AbstractHibernateDAO;
import fr.umlv.m2.uwp2011.persistence.matiere.IMatiereDAO;
import fr.umlv.m2.uwp2011.persistence.matiere.Matiere;
import fr.umlv.m2.uwp2011.persistence.matiere.TroncCommun;

@Repository("hibernateMatiereDAO")
public class HibernateMatiereDAO extends AbstractHibernateDAO<Long, Matiere> implements IMatiereDAO{
	@Override
	public List<Matiere> findByTroncCommun(TroncCommun tronc) {
		String query =  "from Tronc_Commun_Matiere" +
						"where TroncCommun_id = "+ tronc.getId();
		return super.findByQuery(query);
	}
}
